package com.pony.controller.user;

import com.pony.dto.GoodsDTO;
import com.pony.dto.PageDTO;
import com.pony.enums.AppHttpCodeEnum;
import com.pony.result.R;
import com.pony.service.IGoodsService;
import com.pony.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author pony
 * @since 2023-11-16
 */
@Slf4j
@RestController("userGoodsController")
@RequestMapping("/user/goods")
@CrossOrigin(origins = "*")
public class GoodsController {
    @Autowired
    private IGoodsService goodsService;

    /**
     * 根据分类id，查询单个分类信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public R selectOneById(@PathVariable("id") Integer id){
        return goodsService.selectOneById(id);
    }
}
